<template>
  <div ref="energyConsumption1" style="width: 100%; height: 380px"></div>
</template>

<script>
import * as echarts from "echarts";
import { duoShow1 } from "@/api/charts";
export default {
  mounted() {
    this.drawsolid();
  },
  methods: {
    drawsolid() {
      duoShow1()
        .then(({ data }) => {
          var chartDom = this.$refs.energyConsumption1;
          var myChart = echarts.init(chartDom);
          var option;

          option = {
            title: {
              text: "能源整体消耗量",
            },
            parallelAxis: [
              { dim: 0, name: "煤炭" },
              { dim: 1, name: "石油" },
              { dim: 2, name: "天然气" },
              { dim: 3, name: "电力" },
              {
                dim: 4,
                name: "Score",
                type: "category",
                data: ["煤炭", "石油", "天然气","电力","核能"],
              },
            ],
            series: {
              type: "parallel",
              lineStyle: {
                width: 4,
              },
              data
            },
          };

          option && myChart.setOption(option);
        })
        .catch((err) => {});
    },
  },
};
</script>

<style>
</style>